package cn.darkhorse.alarm.service.impl;

import cn.darkhorse.alarm.mapper.AlarmRecordUserInfoMapper;
import cn.darkhorse.alarm.pojo.AlarmRecordUserInfo;
import cn.darkhorse.alarm.service.AlarmRecordUserInfoService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 报警记录用户信息 服务实现类
 * </p>
 *
 * @author maoguanjun
 * @since 2023-04-07
 */
@Service
public class AlarmRecordUserInfoServiceImpl extends ServiceImpl<AlarmRecordUserInfoMapper, AlarmRecordUserInfo> implements AlarmRecordUserInfoService {

    /**
     * @param userId
     * @return
     */
    @Override
    public List<AlarmRecordUserInfo> getRecords(Long userId) {
        LambdaQueryWrapper<AlarmRecordUserInfo> wrapper=new LambdaQueryWrapper<>();
        wrapper.eq(AlarmRecordUserInfo::getUserId,userId);
        List<AlarmRecordUserInfo> list = list(wrapper);
        return list;
    }
}
